load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")
load(
    "//tools:defaults.bzl",
    "ng_e2e_test_library",
    "ng_module",
    "ng_test_library",
    "ng_web_test_suite",
    "sass_binary",
    "sass_library",
)

package(default_visibility = ["//visibility:public"])

ng_module(
    name = "mdc-progress-spinner",
    srcs = glob(
        ["**/*.ts"],
        exclude = [
            "**/*.spec.ts",
        ],
    ),
    assets = [":progress_spinner_scss"] + glob(["**/*.html"]),
    module_name = "@angular/material-experimental/mdc-progress-spinner",
    deps = [
        "//src/cdk/platform",
        "//src/material-experimental/mdc-core",
        "//src/material/progress-spinner",
        "@npm//@angular/common",
        "@npm//@angular/core",
        "@npm//@material/circular-progress",
    ],
)

sass_library(
    name = "mdc_progress_spinner_scss_lib",
    srcs = glob(["**/_*.scss"]),
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
    ],
)

sass_binary(
    name = "progress_spinner_scss",
    src = "progress-spinner.scss",
    include_paths = [
        "external/npm/node_modules",
    ],
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
    ],
)

ng_test_library(
    name = "progress_spinner_tests_lib",
    srcs = glob(
        ["**/*.spec.ts"],
        exclude = ["**/*.e2e.spec.ts"],
    ),
    deps = [
        ":mdc-progress-spinner",
        "//src/cdk/platform",
        "//src/material/progress-spinner",
        "@npm//@angular/common",
        "@npm//@angular/platform-browser",
    ],
)

ng_web_test_suite(
    name = "unit_tests",
    static_files = [
        "@npm//:node_modules/@material/circular-progress/dist/mdc.circularProgress.js",
    ],
    deps = [
        ":progress_spinner_tests_lib",
        "//src/material-experimental:mdc_require_config.js",
    ],
)

ng_e2e_test_library(
    name = "e2e_test_sources",
    srcs = glob(["**/*.e2e.spec.ts"]),
    deps = [
        "//src/cdk/testing/private/e2e",
    ],
)

e2e_test_suite(
    name = "e2e_tests",
    deps = [
        ":e2e_test_sources",
        "//src/cdk/testing/private/e2e",
    ],
)
